package com.bw.basecommon


import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.fragment.app.Fragment
import androidx.viewbinding.ViewBinding

abstract class BaseFragment<B: ViewDataBinding>: Fragment() {

     lateinit var binding:B

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        binding= DataBindingUtil.inflate(inflater,getLayoutID(),container,false)
        initView()
        initData()

        return binding.root

    }


    abstract fun initView()
    abstract fun initData()
    abstract fun getLayoutID(): Int
}